package app.r_teenus.backend.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name = "SERVICE_NOTE")
public class ServiceNote implements Serializable {
	private static final long serialVersionUID = -7127708585215746438L;
	private Integer id = null;
	private Customer customer = null;
	private Employee employee = null;
	private ServiceOrder serviceOrder = null;
	private String noteAuthorType = null;
	private Date created = null;
	private String note = null;
	private ServiceDevice serviceDevice = null;

	/**
	 * Gets id (primary key).
	 */
	@Id
	@Column(name = "SERVICE_NOTE")
	@SequenceGenerator(name = "service_note_id", sequenceName = "service_note_id", allocationSize = 1)
	@GeneratedValue(generator = "service_note_id")
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@OneToOne
	@JoinColumn(name = "CUSTOMER_FK", nullable = false)
	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	@OneToOne
	@JoinColumn(name = "EMPLOYEE_FK", nullable = false)
	public Employee getEmployee() {
		return employee;
	}

	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

	@OneToOne
	@JoinColumn(name = "SERVICE_ORDER_FK", nullable = false)
	public ServiceOrder getServiceOrder() {
		return serviceOrder;
	}

	public void setServiceOrder(ServiceOrder serviceOrder) {
		this.serviceOrder = serviceOrder;
	}

	@Column(name = "NOTE_AUTHOR_TYPE")
	public String getNoteAuthorType() {
		return noteAuthorType;
	}

	public void setNoteAuthorType(String noteAuthorType) {
		this.noteAuthorType = noteAuthorType;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	@OneToOne
	@JoinColumn(name = "SERVICE_DEVICE_FK", nullable = false)
	public ServiceDevice getServiceDevice() {
		return serviceDevice;
	}

	public void setServiceDevice(ServiceDevice serviceDevice) {
		this.serviceDevice = serviceDevice;
	}
}
